//
//  VistorTableViewController.swift
//  weibo
//
//  Created by shixiaoyang on 16/4/7.
//  Copyright © 2016年 shixiaoyang. All rights reserved.
//

import UIKit

class VistorTableViewController: UITableViewController {

    private var userLogon = false
    
    /// 访客视图
    var vistorView: VistorView?

    
    override func loadView() {
        
//        super.loadView()
        // 根据用户的登录情况 决定显示的根视图
        userLogon ? super.loadView() : setupVistorView()
    }
    
    /// 设置访客视图
    private func setupVistorView(){
        //替换根视图
        vistorView = VistorView()
        
        view = vistorView
        
//        view.backgroundColor = UIColor.orangeColor()
        
        // 设置导航栏按钮
        navigationItem.leftBarButtonItem = UIBarButtonItem(title: "注册", style: .Plain, target: nil, action: nil)
        navigationItem.rightBarButtonItem = UIBarButtonItem(title: "登录", style: .Plain, target: nil, action: nil)
    
    }
   

}
